#pragma once
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<assert.h>
using namespace std;
class Date
{
public:
	Date(int year = 2000, int month = 1, int day = 1);
	void Print();
	int GetMonthDay(int year, int month)
	{
		assert(month > 0 && month < 13);
		static int arr[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		if (month == 2 && (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		{
			return 29;
		}
		return arr[month];
	}
	bool CheckDate()
	{
		if (_month < 1 || _month > 12 || _day < 1 || _day > GetMonthDay(_year, _month))
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	Date& operator+=(int day);
	Date& operator-=(int day);
private:
	int _year;
	int _month;
	int _day;
};